/***Hanoi塔问题***/

#include"3.10.h"

int main() {
	int n;
	char a, b, c;
	a = '1';
	b = '2';
	c = '3';
	cout << "请输入初始第一个柱子上的圆盘个数：" << endl;
	cin >> n;
	cout << "将第一个柱子上的圆盘全部移动到第三个柱子上的过程为：" << endl;
	Hanoi(n, a, b, c);
	return 0;
}
/*
T(n) = C + T(n-1) + T(n-2)
T(n-1) = C + T(n-2) + T(n-3)=>T(n)=C+ [C + T(n-2) + T(n-3)]
T(n-2) = C + T(n-3) + T(n-4)=>T(n)=C+ [C + [C + T(n-4) + T(n-5)] + T(n-4)]
T(n-3) = C + T(n-4) + T(n-5)=>T(n)=C+ C + C + C + T(n-4) + T(n-5) + T(n-4) + C + T(n-4) + T(n-5) +C + T(n-4) + T(n-5)
T(n-4) = C + T(n-5) + T(n-6)
T(n-5) = C + T(n-6) + T(n-7)
T(n-6) = C + T(n-7) + T(n-8)
T(n-i) = C + T(n-(i+1)) + T(n-(i+2))
T(2) = C + T(1) + T(0)
T(1) = C
T(0) = D
*/